The present invention relates to defragmentation of a storage device in a computer system and more particularly, to an apparatus and method for minimizing disk fragmentation in real-time.
It is well known that when files are stored to a disk, fragmentation will eventually occur as existing files are modified, new files are added or old files deleted. Fragmentation is a condition where stored files and disk free space both become non-contiguous in nature. Specifically, as defined on page 29 of the book: Fragmentation, the Condition, the Cause, the Cure, by Craig Jensen published by Executive Software, Inc. of Glendale, Calif., the assignee of the present application, file fragmentation is a condition in which individual files are stored on the disk in more than one non-contiguous fragment or extent while free space fragmentation is a condition in which the free space (i.e. unallocated storage locations) on the disk is scattered and substantially non-contiguous.
As will be appreciated, file fragmentation tends to increase as the number of files stored on the disk increases and as files are modified, added, or deleted. Indeed, it is common for a single file to become fragmented into a plurality of pieces often exceeding hundreds or even thousands of fragments scattered about the disk. As files are deleted, free space fragmentation also tends to increase. Eventually, with smaller and smaller amounts of contiguous free space available, even relatively small new files stored on the disk must be fragmented to conform to the available free space. Due to the time required to position the disk drive's read/write head over each fragment and then wait for the rotation of the disk to position the appropriate sector under the head, system performance is significantly impacted each time a fragmented file is transferred to or from the disk.
As with many other operating systems, fragmentation has been determined to be also prevalent in computer systems running under the Windows NT (Windows NT is a trademark of Microsoft Corporation) operating system because most files are not contiguously written to disk. For example, large files have been observed to be stored on the disk drive in as many as twenty thousands fragments. When reading such files, each fragment requires a separate disk access by the computer system resulting in unnecessary disk access operations which significantly decrease system performance and efficiency. In some instances fragmentation may become so severe that the transfer of files to or from disk becomes so slow as to render the disk unusable.
File fragmentation is further increased by the Windows NT disk compression algorithm that operates on portions of each file or file fragment. The compression algorithm individually compresses each portion and often stores the portions in non-contiguous locations. Accordingly, even if files and free space were contiguous, fragmentation, after the compression, will increase.
It should be apparent that files and free space on a disk drive can be rapidly fragmented to such a degree that efficiency and performance of the computer is degraded. Commercially viable software for defragmenting disk drives is available and has been marketed, by way of example, under the name of DISKEEPER by Executive Software, Inc, the present assignee (DISKEEPER is a trademark of Executive Software) for use with the OpenVMS (OpenVMS is a trademark of Digital Equipment Corporation) or Windows NT (version 3, 3.5, and 3.5.1) operating systems. As will be appreciated, commercially available disk drive defragmenting software programs are also available from other commercial vendors. Unfortunately, such software programs are resource intensive because a high percentage of the stored files on the disk drive must be moved in order to defragment the disk. As disk capacity approaches terabytes of stored files, system response time and disk availability will not be optimized due to the inefficiencies of such programs further, such software programs are poorly adapted to efficiently function in conjunction with operating systems such as Windows NT where it is necessary to synchronize movement of files on the disk with data stored in system cache. Further still, such software programs do not optimally defragment a plurality of disk drives connected to a network while the disk drives are active.
Whatever the merits of the above described methods for defragmenting disk storage systems, they do not achieve the benefits of the present invention especially when the computer system is operated under the Windows NT operating system. Accordingly, it is evident that an apparatus and method to efficiently defragment disk drives in a computer system is necessary. It is further evident that an apparatus and method to minimize fragmentation of files and free space in real-time so as to increase utilization or efficiencies of the computer system is necessary.